package com.qst.service.impl;

import com.qst.dao.LessonMapper;
import com.qst.po.Lesson;
import com.qst.service.ILessonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LessonServiceImpl implements ILessonService {
    @Autowired
    private LessonMapper lessonMapper;

    @Override
    public int getTotalCount() {
        return lessonMapper.getTotalCount();
    }

    @Override
    public List<Lesson> getlessonsbypage(int page, int limit) {
        return lessonMapper.getlessonsbypage((page-1)*limit,limit);
    }

    @Override
    public int addlesson(Lesson lesson) {
        return lessonMapper.addlesson(lesson);
    }

    @Override
    public List<Lesson> getalllessons() {
        return lessonMapper.getalllessons();
    }

    @Override
    public Lesson getlessonsbyid(int id) {
        return lessonMapper.getlessonsbyid(id);
    }

    @Override
    public int updatelesson(Lesson lesson) {
        return lessonMapper.updatelesson(lesson);
    }

    @Override
    public int deletelesson(int id) {
        return lessonMapper.deletelesson(id);
    }
}
